<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('新增流程模型')" />
</head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form-model-add">
			<div class="form-group">
				<label class="col-sm-3 control-label ">流程分类：</label>
				<div class="col-sm-8">
<!-- 					<input class="form-control" type="text" name="category" id="category" required> -->
					<select class="form-control" name="category" th:with="type=${@dict.getType('act_category')}">
						<option value="">所有</option>
						<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label ">流程标识：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="key" id="key" required>
					<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 标识需要数字或字母的组合,保存后不能修改<span>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label ">流程名称：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="name" id="name" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">描述：</label>
				<div class="col-sm-8">
					<textarea id="description" name="description" class="form-control"></textarea>
				</div>
			</div>
		</form>
	</div>
	<th:block th:include="include :: footer" />
	<script type="text/javascript" th:inline="javascript">
		var prefix = ctx + "activiti/model";
	
		$("#form-model-add").validate({
			rules:{
				dictSort:{
					digits:true
				},
			},
			focusCleanup: true
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
	        	$.operate.save(prefix + "/createModle", $('#form-model-add').serialize());
	        }
	    }
	</script>
</body>
</html>
